const home = () => import('@/views/home/')
const addressList = () => import('@/views/address/addressList')
const addressEdit = () => import('@/views/address/addressEdit')
const addressAment = () => import('@/views/address/addressAment')
const cart = () => import('@/views/cart')
const gift = () => import('@/views/gift')
const menu = () => import('@/views/menu')
const dialog = () => import('@/views/menu/Dialog')
const mine = () => import('@/views/mine')
const wallet = () => import('@/views/wallet')
const login = () => import('@/views/login')
const register = () => import('@/views/register')
const personalData = () => import('@/views/personalData')
const orderList = () => import('@/views/order/orderList')
const orderConfirm = () => import('@/views/order/orderConfirm')

const navBar = () => import('@/components/NavBar')
const tabBar = () => import('@/components/TabBar')

const routes = [
  {
    path: '/',
    redirect: '/home',
    meta: {}
  },
  {
    // 首页
    path: '/home',
    name: 'Home',
    components: {
      default: home,
      TabBar: tabBar
    },
    meta: {
      title: '首页'
    }
  },
  {
    // 地址列表页面
    path: '/address',
    name: 'AddressList',
    components: {
      default: addressList,
      NavBar: navBar
    },
    meta: {
      title: '地址列表'
    }
  },
  {
    // 新增地址页面
    path: '/address/edit',
    name: 'AddressEdit',
    components: {
      default: addressEdit,
      NavBar: navBar
    },
    meta: {
      title: '新增地址'
    }
  },
  {
    // 修改地址页面
    path: '/address/ament',
    name: 'AddressAment',
    components: {
      default: addressAment,
      NavBar: navBar
    },
    meta: {
      title: '修改地址'
    }
  },
  {
    // 购物车
    path: '/cart',
    name: 'Cart',
    components: {
      default: cart,
      TabBar: tabBar
    },
    meta: {
      title: '购物车'
    }
  },
  {
    // 送他咖啡
    path: '/gift',
    name: 'Gift',
    components: {
      default: gift,
      NavBar: navBar
    },
    meta: {
      title: '送他咖啡'
    }
  },
  {
    // 菜单页面
    path: '/menu',
    name: 'Menu',
    components: {
      default: menu,
      TabBar: tabBar
    },
    meta: {
      title: '菜单'
    }
  },
  {
    // 商品选择
    path: '/menu/Dialog',
    name: 'dialog',
    component: dialog,
    meta: {
      title: '商品选择'
    }
  },
  {
    // 个人中心页面
    path: '/mine',
    name: 'Mine',
    components: {
      default: mine,
      TabBar: tabBar
    },
    meta: {
      title: '个人中心'
    }
  },
  {
    // 钱包
    path: '/wallet',
    name: 'Wallet',
    components: {
      default: wallet,
      NavBar: navBar
    },
    meta: {
      title: '咖啡钱包'
    }
  },
  {
    // 确认订单页面
    path: '/order/confirm',
    name: 'OrderConfirm',
    components: {
      default: orderConfirm,
      NavBar: navBar
    },
    meta: {
      title: '确认订单'
    }
  },
  {
    // 订单列表页面
    path: '/order',
    name: 'OrderList',
    components: {
      default: orderList,
      TabBar: tabBar
    },
    meta: {
      title: '订单列表'
    }
  },
  {
    // 登录页面
    path: '/login',
    name: 'Login',
    components: {
      default: login,
      NavBar: navBar
      // TabBar: tabBar
    },
    meta: {
      title: '登录页面'
    }
  },
  {
    // 注册页面
    path: '/register',
    name: 'Register',
    components: {
      default: register,
      NavBar: navBar
      // TabBar: tabBar
    },
    meta: {
      title: '注册页面'
    }
  },
  {
    // 个人资料
    path: '/personalData',
    name: 'PersonalData',
    components: {
      default: personalData,
      // TabBar: tabBar
      NavBar: navBar
    },
    meta: {
      title: '个人资料'
    }
  }
]

export default routes
